package com.ruoyi.system.service.impl;

import java.util.List;

import cn.hutool.core.util.IdUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BizHouseholdMapper;
import com.ruoyi.system.domain.BizHousehold;
import com.ruoyi.system.service.IBizHouseholdService;

/**
 * 住户Service业务层处理
 *
 * @author ruoyi
 * @date 2023-01-25
 */
@Service
public class BizHouseholdServiceImpl implements IBizHouseholdService
{
    @Autowired
    private BizHouseholdMapper bizHouseholdMapper;

    /**
     * 查询住户
     *
     * @param id 住户主键
     * @return 住户
     */
    @Override
    public BizHousehold selectBizHouseholdById(String id)
    {
        return bizHouseholdMapper.selectBizHouseholdById(id);
    }

    /**
     * 查询住户列表
     *
     * @param bizHousehold 住户
     * @return 住户
     */
    @Override
    public List<BizHousehold> selectBizHouseholdList(BizHousehold bizHousehold)
    {
        return bizHouseholdMapper.selectBizHouseholdList(bizHousehold);
    }

    /**
     * 新增住户
     *
     * @param bizHousehold 住户
     * @return 结果
     */
    @Override
    public int insertBizHousehold(BizHousehold bizHousehold)
    {
        String id = IdUtil.getSnowflakeNextIdStr();
        bizHousehold.setId(id);
        return bizHouseholdMapper.insertBizHousehold(bizHousehold);
    }

    /**
     * 修改住户
     *
     * @param bizHousehold 住户
     * @return 结果
     */
    @Override
    public int updateBizHousehold(BizHousehold bizHousehold)
    {
        return bizHouseholdMapper.updateBizHousehold(bizHousehold);
    }

    /**
     * 批量删除住户
     *
     * @param ids 需要删除的住户主键
     * @return 结果
     */
    @Override
    public int deleteBizHouseholdByIds(String[] ids)
    {
        return bizHouseholdMapper.deleteBizHouseholdByIds(ids);
    }

    /**
     * 删除住户信息
     *
     * @param id 住户主键
     * @return 结果
     */
    @Override
    public int deleteBizHouseholdById(String id)
    {
        return bizHouseholdMapper.deleteBizHouseholdById(id);
    }
}
